Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend bulk ItemAlteration to allow for further modes #18163

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Cerapter
Copy link
Contributor

@Cerapter Cerapter commented Jan 31, 2025

This is a reworked / extended version of PR #18126.

This PR adds or changes the following ItemAlterations:

  • bulk is changed to be able to accept most of the modes. It's add and subtract that's especially noteworthy -- SF2's Soldier can subtract from an armour's Bulk, and PF2 has a few things that add to an item's bulk, like Eyecatcher, Subtle Armour, and the Fortification rune.
  • level has been added to change an item's level. This will prove more useful as part of GrantItem, I believe, especially for effects that grant other effects. I personally ran into a use case with the Wand of Hawthorn, where I wanted to make an effect that grant Oaken Resilience at a given rank, and adds a note about the thorns on being struck with an unarmed attack.
  • flags would just be useful for homebrewing and there is no real justification for it from the system's standpoint (because the system is the system, and the system can just implement shit in code that it needs). The format for the value here is that it must be an object, for example:
    "value": {
      "a": 1,
      "b": {
        "c": 2,
        "d": "whatever"
      }
    With a mode of override, this would make the ItemAlteration add these flags to the item(s), unless of course the types of the values mismatch (for example, if "a" = "test", it couldn't be overwritten by a number). The default location of these flags is flags.pf2e. With a mode of add, and the b.d removed, we could add 1 to a, and 2 to b.c at the same time.

Ultimately, I separate the three into their own commits, so if one is not accepted, so be it, I can revert it.

@stwlam
Copy link
Collaborator

stwlam commented Feb 2, 2025

I think we just need the bulk one out of this. Effect level is propagated via different workflows, and flags just aren't going to happen with that RE.

required: true,
nullable: false,
choices: [0, 0.1, ...Array.fromRange(100, 1)],
Copy link
Collaborator

@stwlam stwlam Feb 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll an additional check here to ensure the resulting value is valid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already round the resulting value to 1/10ths, but I can add a check for it to be nonnegative, at least.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.1 (L) is also the only valid non-integer value since Light bulk isn't a countable unit of measurement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically correct, in practice, the system can actually handle values like "9L" or "3; 4L".

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

@Cerapter Cerapter changed the title Add level and flags as ItemAlteration, extend bulk ItemAlteration Extend bulk ItemAlteration to allow for further modes Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants